package com.jinbo.sxzq;

import android.util.Log;

/***********棋子鼠********************/
public class Chess_Shu extends Chess{
    int[] init_location;
    Chess_Shu(int type, int index, int[] location, int owner , GameControl gameControl) {
        /********初始化信息****************/
        super(index, location, owner , gameControl);
        this.type = type;
        this.name = ProjectConstants.ChessName.SHU;
        this.message = ProjectConstants.ChessMasage.SHU;
        this.type = ProjectConstants.ChessType.SHU;
        this.hp = 1;
        this.maxHp = 1;
        this.mp = 0;
        this.maxMp = 2;
        this.mobility = 1;
        this.maxmobility = 1;
        this.atk  =1;
        init_location = new int[2];
        init_location[0] = location[0];
        init_location[1] = location[1];
    }

    public void Action(){
        super.Action();
    }

    public void Move(Chess chess){
        super.Move(chess);
    }

    public void Attack(Chess chess){
        super.Attack(chess);
    }

    public void RoundNext(){
        super.RoundNext();
    }

    //重写技能鼠：【增殖】消耗2点能量在出生位置生成一个【鼠】。
    public void Skill(){
        super.Skill();
        Log.e("Skill——鼠" , "触发技能");
        if(gameControl.getBoard()[init_location[0]][init_location[1]] == 0){
            Chess chess = new Chess_Shu(type,++gameControl.chess_index,init_location,owner,gameControl);//创建棋子
            gameControl.chess_list.add(0,chess);//加入队列
            gameControl.setBoard(location[0],location[1],type);//放入棋盘
            gameControl.setBoardOwner(location[0],location[1],owner);
            if(owner == ProjectConstants.ChessOwner.OUR){
                gameControl.num_deploy++;
            }
            gameControl.sum_deploy++;
        }
    }

    public void Kill(Chess chess){
        super.Kill(chess);
    }
}
